Using docstrip and doc

If you are going to write a large class or package for LATEX then you should consider using the |doc| software which comes with LATEX. LATEX classes and packages written using this can be processed in two ways: they can be run through LATEX, to produce documentation; and they can be processed with |docstrip|, to produce the |.cls| or |.sty| file.

The |doc| software can automatically generate indexes of definitions, indexes of command use, and change-log lists. It is very useful for maintaining and documenting large TEX sources.

The documented sources of the LATEX kernel itself ,and of the standard classes, etc, are |doc| documents; they are in the |.dtx| files in the distribution. You can, in fact, typeset the source code of the kernel as one long document, complete with index, by running LATEX on |source2e.tex|.

For more information on |doc| and |docstrip|, consult the files |docstrip.dtx|, |doc.dtx|, and . For examples of its use, look at the |.dtx| files.